package com.upcode.weighing.vo.req.pc;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

@Data
@EqualsAndHashCode(callSuper=false)
public class EecalculationFeeReqVo {

    @JsonSerialize(using= ToStringSerializer.class)
    private Long refundOrderId;

    @JsonSerialize(using= ToStringSerializer.class)
    private Long payOrderId;

    private String refundType;

    private Integer vehicleType;

    private String vehicleClass;

    public String checkParams(){
        if(null == refundOrderId){
            return "退费订单ID不可为空";
        }
        if(null == payOrderId){
            return "补缴ID订单不可为空";
        }
        if(StringUtils.isBlank(refundType)){
            return "请选择退费类型";
        }
        if(StringUtils.equals(refundType,"2") && null == vehicleType){
            return "请选择车型";
        }
        if(StringUtils.equals(refundType,"3") && StringUtils.isBlank(vehicleClass)){
            return "请选择车种";
        }
        return null;
    }
}
